﻿Imports Spring.Context
Imports Spring.Context.Support

Public Class BaseDominio
    Implements IRepositorio

    Private _id As Nullable(Of Long)
    Public Overridable Property Id() As Nullable(Of Long)
        Get
            Return _id
        End Get
        Set(ByVal value As Nullable(Of Long))
            _id = value
        End Set
    End Property

    Private _repositorio As IRepositorio
    Protected Overridable Property Repositorio() As IRepositorio
        Get
            Return _repositorio
        End Get
        Set(ByVal value As IRepositorio)
            _repositorio = value
        End Set
    End Property

    Public Sub New()
        Console.WriteLine("Injecting")
        Dim _contextoDoSpring As IApplicationContext = ContextRegistry.GetContext()
        Dim _repositorio As IRepositorio
CONFIGURE_AQUI: SE NAO CONFIGURAR NAO VAI COMPILAR
        _repositorio = DirectCast(_contextoDoSpring("Repositorio"), IRepositorio)
        Me.Repositorio = _repositorio

    End Sub

#Region "Classes Injetadas"


    'FIM
#End Region

End Class
